package org.webball.base.interfaces;

import java.io.Serializable;

import org.webball.base.abstracts.AbstractBall;
import org.webball.base.abstracts.AbstractPlayer;
import org.webball.tools.MKVector;

/**
 * Interface represents pitch in the game.
 * Includes two teams, ball and updates their status.
 * Also counts points and setpoints by checking fouls.
 * 
 * @author Maciej Koch
 *
 */
public interface IPitch extends Serializable{

	/**
	 * updates state of the pitch
	 */
	public void update();
	
	/**
	 * 
	 * @param i
	 * - which team select (0 or 1)
	 * @return selected team or <code>null</code> if index is out of array
	 */
	public ITeam getTeam(int i);
	
	/**
	 * sets new Team
	 * @param i
	 * - which team set
	 * @param team
	 * - includes 6 players
	 */
	public void setTeam(int i, ITeam team);
	
	/**
	 * 
	 * @param mousePosition
	 * - mouse position
	 * @param team
	 * - sets team number to control
	 * @return selected player or null if no selected
	 */
	public AbstractPlayer clickOnPlayer(MKVector mousePosition, int team);
	/**
	 * 
	 * @return ball
	 */
	public AbstractBall getBall();
	/**
	 * 
	 * @return true if it is tactical phase, false if is not
	 */
	public boolean isTacticalPhase();
	/**
	 * 
	 * @return time to end phase
	 */
	public int getTimetoEndPhase();
	
	/**
	 * 
	 * @return which team won or -1 if no end
	 */
	public int isEndOfGame();
	
	/**
	 * Copies values from specified pitch.
	 * @param pitch
	 * - pitch, not <code>null</code>
	 */
	public void copy(IPitch pitch);

	/**
	 * deselect all player
	 * @param team- deselect which team player
	 */
	void deselectAllPlayers(int team);
	
	
	
}
